package ar.uade.edu.fain.ad.server.dao.entity;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "CARTA")
public class CartaEntity {

	@Id
	private Long id;

	@ManyToMany
	@JoinTable(name = "CARTA_PLATO", 
			joinColumns = @JoinColumn(name = "idCarta"), 
			inverseJoinColumns = @JoinColumn(name = "idPlato"))
	private List<PlatoEntity> platos;

	private Boolean activa;

	@ManyToOne
	@JoinColumn(name = "idLocal")
	private LocalEntity local;

	public CartaEntity() {
		super();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public List<PlatoEntity> getPlatos() {
		return platos;
	}

	public void setPlatos(List<PlatoEntity> platos) {
		this.platos = platos;
	}

	public Boolean isActiva() {
		return activa;
	}

	public void setActiva(Boolean activa) {
		this.activa = activa;
	}

	public void setLocal(LocalEntity local) {
		this.local = local;
	}

	public LocalEntity getLocal() {
		return local;
	}
}
